package top.zywork.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Animo
 * @Date 2020/11/27
 * @Blog http://www.ljyanimo.com
 */
@Getter
public enum  PrintSpecEnum {


    ZZLX("zzlx","纸张类型"),
    YS("ys","颜色"),
    DSM("dsm","单双面"),
    SY("suoyin","缩印(多合一)"),
    ZHUANGDING("zhuangding","装订"),;
//    SL("dj","数量单价"),;

    private String key;
    private String value;

    public final static List<String> list = new ArrayList<>();
    static {
        list.add("纸张类型");
        list.add("颜色");
        list.add("单双面");
        list.add("缩印(多合一)");
        list.add("装订");
//        list.add("数量单价");
    }

    PrintSpecEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getKey(String value){
        PrintSpecEnum[] values = PrintSpecEnum.values();
        for(PrintSpecEnum printSpecEnum : values){
            if(printSpecEnum.getValue().equals(value)){
                return printSpecEnum.getKey();
            }
        }
        return null;
    }
}
